import jieba
from variant import total_text

jieba.add_word("八宝鸭")
jieba.add_word("牛毽子肉")
jieba.add_word("帝王蟹")
jieba.add_word("红膏炝蟹")
jieba.add_word("红膏蟹")
jieba.add_word("下水管道")
jieba.add_word("卤牛肉")

# 使用jieba进行分词
all_texts_cut = [" ".join(jieba.cut(text)) for text in total_text]

# 保存分词结果到文件，因为FastText需要从文件读取数据
with open("all_texts_cut.txt", "w", encoding="utf-8") as f:
    for text in all_texts_cut:
        f.write(text + "\n")